﻿/**
* File: XmglxmxxController.cs
* Author: 汪杰
* Create Time:2025/2/21 13:52:59
* Email:15200358008@139.com
* 代码由TMCodeGenerator自动生成
**/
using JSLCloud.App.Mes.Models;
using JSLCloud.App.Mes.Service;
using JSLCloud.App.Models.Report;
using JSLCloud.App.Models.Xmglxmxx;
using JSLCloud.App.Models.Xmjckhxx;
using JSLCloud.App.Models.Xmkhgdgl;
using JSLCloud.App.Models.Xmkhgltx;
using JSLCloud.Framework;
using JSLCloud.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace JSLCloud.App.Mes.Controllers
{
    /// <summary>
    /// xm_gl_xmxx Controller
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class ReportController : ControllerBase
    {
        private readonly IReportService _service;
        
        /// <summary>
        /// 默认构造函数
        /// </summary>
        public ReportController(IReportService service)
        {
            _service = service;
        }
        
        /// <summary>
        /// 获取xm_gl_xmxx数据表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("[action]")]
        public async Task<ResponseObject<List<float>>> GetOrderData()
        {
            return await _service.GetOrderDataAsync();
        }

        /// <summary>
        /// 获取xm_gl_xmxx数据表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("[action]")]
        public async Task<ResponseObject<FirstPageQueryModel>> GetFirstData(string requestObject)
        {
            return await _service.GetFirstDataAsync();
        }

        /// <summary>
        /// 获取xm_gl_xmxx数据表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("[action]")]
        public async Task<ResponseObject<FirstPageQueryModel>> GetFirstData2(string requestObject)
        {
            return await _service.GetFirstData2Async();
        }

        /// <summary>
        /// 获取xm_gl_xmxx数据表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("[action]")]
        public async Task<ResponseObject<List<XmglxmxxQueryModel>>> GetOrderReport(string requestObject)
        {
            var request = JsonConvert.DeserializeObject<RequestGet>(requestObject);
            return await _service.GetOrderReportAsync(request);
        }

        /// <summary>
        /// 获取xm_gl_xmxx数据表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("[action]")]
        public async Task<ResponseObject<List<XmjckhxxQueryReportModel>>> GetCustomReport(string requestObject)
        {
            var request = JsonConvert.DeserializeObject<RequestGet>(requestObject);
            return await _service.GetCustomReportAsync(request);
        }

        /// <summary>
        /// 获取xm_gl_xmxx数据表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("[action]")]
        public async Task<ResponseObject<List<XmkhgltxReportModel>>> GetCertificateReport(string requestObject)
        {
            var request = JsonConvert.DeserializeObject<RequestGet>(requestObject);
            return await _service.GetCertificateReportAsync(request);
        }

        /// <summary>
        /// 获取xm_gl_xmxx数据表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("[action]")]
        public async Task<ResponseObject<List<float>>> GetReceiveData()
        {
            return await _service.GetReceiveDataAsync();
        }

        /// <summary>
        /// 获取xm_gl_xmxx数据表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("[action]")]
        public async Task<ResponseObject<List<float>>> GetExpensesData()
        {
            return await _service.GetExpensesDataAsync();
        }

        /// <summary>
        /// 获取BOM信息
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("[action]")]
        public async Task<ResponseObject<List<WorktimeQueryModel>>> GetWorktimeReport(string requestObject)
        {
            var request = JsonConvert.DeserializeObject<RequestGet>(requestObject);
            return await _service.GetWorktimeReportAsync(request);
        }

    }
}
